<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>新增页面</title>
		<link rel="stylesheet" href="/new/component/pear/css/pear.css" />
		<script src="/js/jquery-2.2.4.js" type="text/javascript"></script>
	</head>
	<body>
		<form class="layui-form" id="ifrom">
			<div class="mainBox">
				<div class="main-container">
					<div class="layui-form-item">
						<label class="layui-form-label">账号</label>
						<div class="layui-input-block">
							<input type="text" name="user_account" lay-verify="title" autocomplete="off" placeholder="请输入标题"
								class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div class="layui-input-block">
							<input type="text" name="user_password" lay-verify="title" autocomplete="off" placeholder="请输入标题"
								class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">备注</label>
						<div class="layui-input-block">
							<input type="text" name="user_remark" lay-verify="title" autocomplete="off" placeholder="请输入标题"
								class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">序号</label>
						<div class="layui-input-block">
							<input type="text" name="user_idcard" lay-verify="title" autocomplete="off" placeholder="请输入标题"
								class="layui-input">
						</div>
					</div>




				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="button" class="pear-btn pear-btn-primary pear-btn-sm" onclick="show()">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="pear-btn pear-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
		<script src="/new/component/layui/layui.js"></script>
		<script src="/new/component/pear/pear.js"></script>
<script>
	function show(){
		$.ajax({
			async:false,
			url:"/user/sava",
			type:"post",
			data:$("#ifrom").serialize(),
			dataType:"json",
			success:function (data){
				if (data.code =="1" ){
					alert("新增成功")
					window.location.href="/user/users.html";
				}else {
					alert("新增失败")
					window.location.reload();
				}
			}
		})
	}
</script>

	</body>
</html>
